Hybrid control of haptic feedback for host computer and interface device

ABSTRACT

A hybrid haptic feedback system in which a host computer and haptic feedback device share processing loads to various degrees in the output of haptic sensations, and features for efficient output of haptic sensations in such a system. A haptic feedback interface device in communication with a host computer includes a device microcontroller outputting force values to the actuator to control output forces. In various embodiments, the microcontroller can determine force values for one type of force effect while receiving force values computed by the host computer for a different type of force effect. For example, the microcontroller can determine closed loop effect values and receive computed open loop effect values from the host; or the microcontroller can determine high frequency open loop effect values and receive low frequency open loop effect values from the host. Various features allow the host to efficiently stream computed force values to the device.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a continuation of application Ser. No. 09/687,744,filed Oct. 13, 2000 now U.S. Pat. No. 6,411,276, entitled “HybridControl of Haptic Feedback for Host Computer and Interface Device,”which is a continuation-in-part of U.S. patent application Ser. No.09/322,245 filed May 28, 1999 now U.S. Pat. No. 6,278,439, entitled,“Shaping Force Signals Output by a Force Feedback Device,” which is acontinuation of U.S. patent application Ser. No. 08/747,841, now U.S.Pat. No. 5,959,613, filed Nov. 13, 1996; and this application claims thebenefit of U.S. Provisional applications No. 60/160,401, filed Oct. 19,1999, entitled, “Hybrid Control of Force Feedback for a Host Computerand Interface Device,” and Ser. No. 60/221,496, filed Jul. 27, 2000,entitled, “Hybrid Control of Vibrations in Haptic Feedback Devices.”

Certain inventions provided herein were made with government supportunder Contract Number M67004-97-C-0026, awarded by the Department ofDefense. The government has certain rights in these inventions.

BACKGROUND OF THE INVENTION

The present invention relates generally to interface devices forallowing humans to interface with computer systems, and moreparticularly to low-cost computer interface devices that allow computersystems to provide haptic feedback to the user.

Haptic feedback interface devices are currently available to interface aperson with a host computer device such as a personal computer, gameconsole, portable computer, or other type of computer. Several differenttypes of consumer level haptic feedback devices are available, includingjoysticks, mice, steering wheels, gamepads, etc. The computer displays agraphical environment such as a game, graphical user interface, or otherprogram and the user controls a graphical object or other aspect of thegraphical environment by inputting data using the interface device,typically by moving a manipulandum or “user manipulatable object” suchas a joystick handle or steering wheel. The computer also may outputhaptic feedback information to the interface device which controls thedevice to output haptic feedback to the user using motors or otheractuators on the device. The haptic feedback is in the form ofvibrations, spring forces, textures, or other sensations conveyed to theuser who is physically grasping or otherwise contacting the device. Thehaptic feedback is correlated to events and interactions in thegraphical environment to convey a more immersive, entertaining, andfunctional environment to the user. In some interface devices,kinesthetic feedback is provided, while others may provide tactilefeedback; these are collectively and generally referenced herein as“haptic feedback.”

In most commercially available haptic feedback interface devices, thegoal has been to reduce the processing loading on the host computer byoffloading as much of the processing as possible to the device itself.Thus, while haptic feedback devices may have significant differences,most of the more sophisticated devices share a common feature: a localmicrocontroller on the device that is able to compute and output forcesas directed by high-level commands from the host computer. Thesedual-architecture systems produce very high quality haptic feedbackoutput while presenting a minimal processing load on the host system.

However, in order to achieve these capabilities on the device, there isa price to pay. The force computations that are required to generate theoutput can be computationally expensive operations. As a result, themicrocontroller that is embedded in the interface device needs to besufficiently powerful in order to handle this processing. The end resultis that the device microcontroller is expensive, and the completedinterface products have a significant cost to consumers. While thisextra cost is bearable when the market for these devices is new, thecost of these consumer devices is constantly being driven to lowerlevels as the market continues to mature.

In order to reduce the processing power (and thereby the cost) of thedevice microcontroller and maintain the product quality level, otheralternate solutions should be explored.

SUMMARY OF THE INVENTION

The present invention is directed to a hybrid haptic feedback system inwhich a host computer and haptic feedback device can share processingloads to various degrees in the output of haptic sensations, and is alsodirected to features for efficient output of haptic sensations in such asystem.

More particularly, a haptic feedback interface device in communicationwith a host computer includes a user manipulatable object physicallycontacted and moveable by a user, an actuator outputting forces felt bythe user, a sensor detecting motion of the user manipulatable object,and a device microcontroller outputting force values to the actuator tocontrol the forces and receiving sensor signals. The microcontrollerdetermines a closed loop force value based at least in part on a sensorsignal and outputs the closed loop force value to the actuator. Themicrocontroller does not compute open loop force values but insteadreceives open loop force values from the host computer and directs thethese force values to the actuator. Preferably, the open loop forcevalues are primarily based on time, such as periodic forces, and arecomputed on the host computer. The closed loop forces, such as springsand damping forces, are based on user object position or motion and arecomputed on the local microcontroller. The open loop force values can bereceived from the host over a streaming serial communication channel.

Other features allow the microcontroller to extrapolate a force value oroutput a previously received force value if a force value received fromthe host is corrupted or missing; or to terminate an output force if atime from receiving host force values reaches a predetermined length. Anemulator layer on the host which computes force values can emulate ahaptic feedback device so that a host application program or other hostlayer sends a command as if it were sending the command to the hapticfeedback device. A streaming channel of force values can be keptcontinuously full of streaming data by providing a transfer request to acommunication driver on the host while the communication driver isoutputting data from a previous transfer request to the device. Forcevalues can be stored by the host and retrieved to be output as repeatingforce values.

In another aspect of the present invention, a method for providinghaptic feedback functionality on a host computer in a hybrid systemincludes receiving on a driver of the host computer a command providedby an application program to provide a force effect having a type. Basedon the type of force effect, information derived from the command iseither directed to the haptic feedback device so the device computes aforce value from the information, or information derived from thecommand is stored in memory of the host and a force value is computedusing the driver, where the driver provides the computed force value tothe haptic feedback device. The force value is output as a force by thehaptic feedback device to a user of the haptic feedback device. In oneembodiment, the type is either open loop or closed loop, where the forcevalue from the closed loop effect is computed by the haptic feedbackdevice and the force value from the open loop effect is computed by thedriver. The driver can emulate a haptic feedback device so that theapplication program is ignorant of any division in computation offorces. The driver can select a particular period of sending informationto the device based on a processing burden on the host computer ordevice or communication bandwidth.

In another aspect of the present invention, a force feedback interfacedevice includes a user manipulatable object, an actuator outputtingforces felt by the user, a sensor detecting motion of the usermanipulatable object, and a device microcontroller determining a forcevalue of a high frequency open loop effect based at least in part on acommand received from the host computer. The microcontroller does notdetermine force values for low frequency open loop effects and insteadreceives the low frequency open loop force values from the host. Themicrocontroller directs all open loop force values to the actuator. Thelow frequency open loop force values preferably describe an effecthaving a frequency under a threshold frequency, and high frequency openloop values are for an effect having a frequency over the thresholdfrequency. The open loop force values can define vibration forceeffects. Similar or other embodiments allow the microcontroller todetermine closed loop force values based at least in part on sensorsignals describing a position or motion of the user manipulatableobject, where the microcontroller does not determine low frequency openloop force values and receives low frequency open loop force values fromthe host computer to be output by the actuator.

The present invention advantageously provides a hybrid haptic feedbacksystem that allows the processing burden to be shared between device andhost to different degrees depending on the needs of the system designeror producer. The greater the processing burden the host takes on, theless expensive the device can be made; various features of the presentinvention allow the host to tale on a greater processing burden thanallowed by existing dual-architecture haptic feedback systems yetmaintain quality haptic feedback.

These and other advantages of the present invention will become apparentto those skilled in the art upon a reading of the followingspecification of the invention and a study of the several figures of thedrawing.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a haptic feedback system suitablefor use with the present invention;

FIG. 2 is a block diagram illustrating a hierarchy of software layersthat can operate on the host computer system;

FIG. 3 is a block diagram illustrating communication in one embodimentbetween the emulator and the operating system communication driver ofthe host system; and

FIG. 4 is a block diagram illustrating an embodiment for modifying atransfer buffer of the host to achieve improved streaming performance.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

In many preferred embodiments, the present invention reduces thecomplexity of the device microcontroller and maintains the quality ofhaptic feedback by sharing the force processing loading between thedevice microcontroller and the processor of the host computer. Thissharing of processing results in a “hybrid” haptic feedback system thatfunctions much like existing haptic systems but allows a more limited,inexpensive processor to be used in the interface device and allows thehost computer to handle at least a portion of the computations yetmaintain the overall quality of the haptic feedback system. Severalinventive embodiments and aspects of a hybrid system are describedherein.

FIG. 1 is a block diagram illustrating a haptic feedback interfacesystem 10 suitable for use with the present invention controlled by ahost computer system. Interface system 10 includes a host computersystem 12 and an interface device (“device”) 14.

Host computer system 12 can be any of a variety of computing devices.Host 12 can be a personal computer, such as a PC or Macintosh personalcomputer, or a workstation, such as a SUN or Silicon Graphicsworkstation. Alternatively, host computer system 12 can be one of avariety of home video game systems, such as systems available fromNintendo, Sega, or Sony, a television “set top box” or a “networkcomputer”, a portable computer, game device, personal digital assistant,arcade game machine, main microprocessor in a vehicle or other system,etc. Host computer system 12 preferably implements one or more hostapplication programs with which a user 22 is interacting via peripheralsand haptic feedback interface device 14. For example, the hostapplication program can be a video game, medical simulation, scientificanalysis program, operating system, graphical user interface, or otherapplication program that utilizes haptic feedback. Typically, the hostapplication provides images to be displayed on a display output device,as described below, and/or other feedback, such as auditory signals.

Host computer system 12 preferably includes a host microprocessor 16,random access memory (RAM) 17, read-only memory (ROM) 19, input/output(I/O) electronics 21, a clock 18, a display screen 20, and an audiooutput device 21. Display screen 20 can be used to display imagesgenerated by host computer system 12 or other computer systems, and canbe a standard display screen, CRT, flat-panel display, 3-D goggles,visual projection device, or any other visual output device. Audiooutput device 21, such as speakers, is preferably coupled to hostmicroprocessor 16 via amplifiers, filters, and other circuitry wellknown to those skilled in the art (e.g. in a sound card) and providessound output to user 22 from the host computer 12. Other types ofperipherals can also be coupled to host processor 16, such as storagedevices (hard disk drive, CD ROM/DVD-ROM drive, floppy disk drive,etc.), printers, and other input and output devices. Data forimplementing the interfaces of the present invention can be stored oncomputer readable media such as memory (e.g., RAM or ROM), a hard disk,a CD-ROM or DVD-ROM, etc.

An interface device 14 is coupled to host computer system 12 by abi-directional bus 24. The bi-directional bus sends signals in eitherdirection between host computer system 12 and the interface device, andcan be a serial bus, parallel bus, Universal Serial Bus (USB), Firewire(IEEE 1394) bus, wireless communication interface, etc. An interfaceport of host computer system 12, such as an RS232 or Universal SerialBus (USB) serial interface port, parallel port, game port, etc.,connects bus 24 to host computer system 12.

Interface device 14 includes a local microprocessor 26, sensors 28,actuators 30, a user object 34, optional sensor interface 36, anoptional actuator interface 38, and other optional input devices 39.Local microprocessor 26 is coupled to bus 24 and is considered local tointerface device 14 and is dedicated to haptic feedback and sensor I/Oof interface device 14. Microprocessor 26 can be provided with softwareinstructions to wait for commands or requests from computer host 16,decode the commands or requests, and handle/control input and outputsignals according to the commands or requests. In addition, processor 26preferably operates independently of host computer 16 by reading sensorsignals and calculating appropriate forces from those sensor signals,time signals, and stored or relayed instructions selected in accordancewith a host command. Suitable microprocessors for use as localmicroprocessor 26 include the I-Force Processor from Immersion Corp.,the MC68HC711E9 by Motorola, the PIC16C74 by Microchip, and the 82930AXby Intel Corp., for example, or more lower-end microprocessors in someembodiments (e.g. if the host is sharing significant force processingaccording the present invention). Microprocessor 26 can include onemicroprocessor chip, or multiple processors and/or co-processor chips,and/or digital signal processor (DSP) capability. In some embodiments,the microprocessor 26 can be more simple logic circuitry, statemachines, or the like.

Microprocessor 26 can receive signals from sensors 28 and providesignals to actuators 30 of the interface device 14 in accordance withinstructions provided by host computer 12 over bus 24. For example, in apreferred local control embodiment, host computer system 12 provideshigh level supervisory commands to microprocessor 26 over bus 24, andmicroprocessor 26 manages low level force control loops to sensors andactuators in accordance with the high level commands and independentlyof the host computer 18. The haptic feedback system thus provides a hostcontrol loop of information and a local control loop of information in adistributed control system. This operation is described in greaterdetail in U.S. Pat. No. 5,739,811 and U.S. patent application Ser. Nos.08/877,114 and 08/050,665 (which is a continuation of U.S. Pat. No.5,734,373), all incorporated by reference herein in their entirety. Themicroprocessor 26 is preferably operative to implement local closed loopeffects dependent on position (and/or velocity, acceleration) of theuser manipulatable object, as well as operative to receive commands foropen loop effects which are calculated and directly output whenconditions are appropriate, although the host can share in thisprocessing according to the present invention, as described in detailbelow. Microprocessor 26 can also receive commands from any other inputdevices 39 included on interface apparatus 14, such as buttons, andprovides appropriate signals to host computer 12 to indicate that theinput information has been received and any information included in theinput information. Local memory 27, such as RAM and/or ROM, ispreferably coupled to microprocessor 26 in interface device 14 to storeinstructions for microprocessor 26 and store temporary and other data.In addition, a local clock 29 can be coupled to the microprocessor 26 toprovide timing data.

Sensors 28 sense the position, motion, and/or other characteristics of auser manipulatable object 34 of the interface device 14 along one ormore degrees of freedom and provide signals to microprocessor 26including information representative of those characteristics. Rotary orlinear optical encoders, potentiometers, optical sensors, velocitysensors, acceleration sensors, strain gauge, or other types of sensorscan be used. Sensors 28 provide an electrical signal to an optionalsensor interface 36, which can be used to convert sensor signals tosignals that can be interpreted by the microprocessor 26 and/or hostcomputer system 12.

Actuators 30 can transmit forces to user object 34 of the interfacedevice 14 in one or more directions along one or more degrees of freedomin response to “force values” received from microprocessor 26. A forcevalue can indicate a magnitude of force to be output by the actuator,and may also in some embodiments indicate direction of force output inthe degree of freedom of force output of the actuator. In someembodiments, the actuators 30 transmit forces to the housing of thedevice 14 (instead of or addition to object 34) which are felt by theuser. Actuators 30 can include two types: active actuators and passiveactuators. Active actuators include linear current control motors,stepper motors, pneumatic/hydraulic active actuators, a torquer (motorwith limited angular range), voice coil actuators, and other types ofactuators that transmit a force to move an object. Passive actuators canalso be used for actuators 30, such as magnetic particle brakes,friction brakes, or pneumatic/hydraulic passive actuators. Actuatorinterface 38 can be optionally connected between actuators 30 andmicroprocessor 26 to convert signals from microprocessor 26 into signalsappropriate to drive actuators 30. Optionally, some or all of thefunctionality of the sensor interface 36 and/or actuator interface 38can be incorporated into the microprocessor 26, such as pulse widthmodulation (PWM) controllers for actuators, encoder processingcircuitry, etc. Force values can be implemented as analog signals, PWMsignals, or other signals that are input to the actuator.

Other input devices 39 can optionally be included in interface device 14and send input signals to microprocessor 26 or to host processor 16.Such input devices can include buttons, dials, switches, levers, orother mechanisms. For example, in embodiments where user object 34 is ajoystick, other input devices can include one or more buttons provided,for example, on the joystick handle or base. Power supply 40 canoptionally be coupled to actuator interface 38 and/or actuators 30 toprovide electrical power. A safety switch 41 is optionally included ininterface device 14 to provide a mechanism to deactivate actuators 30for safety reasons.

User manipulable object 34 (“user object” or “manipulandum”) is aphysical object, device or article that may be grasped or otherwisecontacted or controlled by a user and which is coupled to interfacedevice 14. By “grasp”, it is meant that users may releasably engage agrip portion of the object in some fashion, such as by hand, with theirfingertips, or even orally in the case of handicapped persons. The user22 can manipulate and move the object along provided degrees of freedomto interface with the host application program the user is viewing ondisplay screen 20. Object 34 can be a joystick, mouse, trackball,stylus, steering wheel, sphere, medical instrument (laparoscope,catheter, etc.), pool cue (e.g. moving the cue through actuatedrollers), hand grip, rotary or linear knob, button, gamepad, gamepadcontrol, gun-shaped targeting device, or other article. Many types ofmechanisms and linkages can also be employed to provide the degrees offreedom to the user manipulatable object, as well as amplificationtransmissions such as gears, capstan drives, and belt drives, to amplifymovement for increased sensor resolution and amplify forces for output.In some embodiments, the user object and/or the device itself can be ahandheld device, e.g., a gamepad controller for video games or computergames, a portable computing device, or a hand-held remote control deviceused to select functions of a television, video cassette recorder, soundstereo, internet or network computer (e.g., Web-TV™).

Hybrid Architecture

The “hybrid” architecture of the present invention allows sharing of theforce processing between the haptic feedback interface device and thehost computer. In a hybrid architecture, the host computer computes atleast some of the force values that are sent to the actuators of thedevice, thus reducing the processing requirements of the localmicroprocessor 26 on the device. A “force value” is a value thatindicates a magnitude and (in some cases) a direction of a force andwhich can be directly translated into that force by the actuator and/orby an actuator interface, such as a PWM circuit. For example, a forcevalue can be provided for each axis or degree of freedom for a device(including direction on that axis), or a force value can include amagnitude portion and a direction portion for a force in amulti-dimensional space. In preferred hybrid embodiments, force valuessent from the host system to the device can be summed with any forcevalues computed on the device. In some embodiments, the device can thenperform post-processing on the total force value to implement suchfeatures as kinematics, linearization, and safety ramping, if suchfeatures are present, and the processed force value is sent to anactuator as an appropriate signal to be output as a force.

Implementing a hybrid device presents several technical challenges thatneed to be overcome to make this invention feasible. The firstsignificant issue to deal with is the architecture of the hybrid system.One basic goal of the hybrid architecture is to employ some of the hostprocessing power in order to compute force values over time. Onesolution is to allow the host to precompute the force output values foreach time step of a force effect that is to be output and transfer thisdata to the device before the force effect is to be output, where thedevice can output the effect when it is required. This approach allowssome variance in the time of delivery of the force values to the deviceas long as the host sends values before they are needed to be output.However, since high quality force output requires updating the output onthe order of hundreds of times a second, this would require the deviceto have sufficiently large memory to store the force samples for a largeportion of the effect, such as an entire period. The cost of thisadditional memory, which would likely be comparable to the savingsobtained by scaling the device microcontroller back, makes this optionpotentially less desirable.

Another solution is to have the host system compute the force outputs in“real time” and send this data to the device at a fixed periodic rate.This method would not require the extra device memory, as the data isdelivered to the device from the host as it is required and is directlyoutput by the device. However, the host system would be required tocompute the output at relatively high output rates.

Another issue that exists, regardless of the system architecture, is theprocessing loading that would be added to the host system. Because thecomputation of the force output values is a relatively complex process,moving this computation loading to the host system could have asignificant impact on the host system performance. This may beespecially true in processor-intensive host applications such as agaming environment, where the host processor is already significantlyloaded performing the computations to handle the graphics and audiooutput.

Despite these issues, there are two industry trends that will make theshared processing architecture become more feasible over time. First,the processing power of computer systems is growing rapidly. If it isassumed that the computations required to handle haptic feedback outputremain relatively consistent, then the percentage of the processingpower required from the host system will only decrease over time. Thiswill continue to reduce the impact of any force processing on the hostsystem.

The second trend that aids the shared processing architecture is theintroduction of newer peripheral communication busses that are designedto support the concept of an isochronous or streaming data channel. Ifthe host system were to attempt to generate a fixed period output streamusing traditional peripheral busses, it would greatly complicate thehost software. This is especially true for a desktop operating system,such as Microsoft Windows™, as it is not a goal of these systems toallow true real time operation. Busses that have built in support forisochronous data transfers greatly aid the host system and significantlyreduce the processing burden required to ensure the data transfers occurat a fixed frequency. Examples of peripheral busses that provide supportfor isochronous data transfers include Firewire (IEEE 1394) and theUniversal Serial Bus (USB).

Embodiments

The following description details investigative work concerning theissues and implementations of a consumer haptic feedback device thatuses a shared processing, or hybrid, architecture. A basic architectureof host computer and device processor, such as shown in FIG. 1, are alsodescribed in greater detail in U.S. Pat. No. 5,734,373 and in U.S. Pat.No. 5,959,613 (and U.S. application Ser. No. 09/322,245), which are allincorporated herein by reference in their entirety.

Basic Architecture

A fundamental goal of this invention is to increase the capabilities ofa simple, low-cost haptic feedback device connected to a host computerby using some of the host system's processing to emulate a device withincreased processing power. An “emulation layer” “emulator”), e.g. asoftware functionality layer, can be implemented on the host to handlethis emulation of a highly capable device. Many differentimplementations of the emulator can be provided. However, in somesystems (such as Microsoft® Windows™), significant advantages are gainedif a very low level driver on the host implements the emulation layer onthe host system, e.g. a driver situated below most other programsrunning on the host computer in the hierarchy of programs running. Thereare several reasons for this.

One reason is that, since the host operating system cannot determinewhether the capabilities being enumerated are being emulated or not, itwill treat a fully capable device and an emulated device identically.This means that any software that can use the fully capable device willbe able to use the emulated device without any changes. Another reasonsis that, by performing the emulation processing at a very low level inthe system, there is reduced overhead to perform the transfers from thehost to device. Since these transfers are occurring very frequently,this processing reduction will result in an increase in systemperformance.

FIG. 2 shows a hierarchy 100 of implementation levels implemented inhost software at a general level. An application program 102 is runningat the top level, and other application programs may also be running ina multi-tasking environment. An application program interface (API) 104communicates with the application 102 to implement function calls andother tasks. For example, in the Windows operating system, theDirectInput API can be used with haptic feedback interface devices.Below the API 104, a haptic feedback driver 106 is running, whichtypically is specific to a particular device or a class of devices. Thehaptic feedback driver 106 can implement particular calls and commandsto a haptic feedback device based on API and/or application commands andinterface with the device at a lower level. The device class driver 108can be situated below the haptic feedback driver, and is used todetermine a class of input device based on information provided from thedevice. For example, in a Windows™ system, the Hid.dll and theHidClass.sys files can perform this function. Below the device classdriver 108 is a preferred layer position for the emulation layer 110 ofthe present invention. Below the emulation layer 110 is thecommunication driver 112 which uses the communication hardware 114 tocommunicate directly with the haptic feedback device 116 over a bus 118.For example, in a Windows USB system, the USBD interface can be used asthe communication driver to communicate with the device usingcommunication hardware such as the OHCI or UHCI host controllers, as iswell known in the art.

Even though the emulation may function better if it is lower in thesystem driver stack, it is possible to handle the emulation at adifferent, e.g. higher, level and still function. For example, theapplication program 102 itself, or a driver just below the applicationprogram, could handle the host effects. Herein, the term “driver” isintended to mean any program running on the host computer below theapplication program level that can implement the force-related functionsand features described herein.

The methods and embodiments described below, such as the emulatorfunctionality, may be implemented with program instructions or codestored on or transferred through a computer readable medium. Such acomputer readable medium may be digital memory chips or other memorydevices; magnetic media such as hard disk, floppy disk, or tape; orother media such as CD-ROM, DVD, PCMCIA cards, etc. The programinstructions may also be transmitted through a channel (network,wireless transmission, etc.) to the host computer or device (whereappropriate) from a different source. Some or all of the programinstructions may also be implemented in hardware, e.g. using logicgates.

Streaming Processing

In order for the host system to effectively perform emulation for thedevice, it will need to execute computational processing to generate theforce output in a timely manner. Since many other processes areoperating on the host system in addition to this force processing,generating this timely execution presents several issues.

Determining the frequency of execution for the emulation processing is abit of a tradeoff. It needs to be fast enough that the device appears tobe responsive to the requests of the host software. However, eachexecution of the emulation processing will generally have some overheadprocessing time involved. This can take many forms on the host systemincluding an interrupt context switch or a thread context switch. Indetermining the final frequency of execution, these two factors must bebalanced against one another in a compromise.

There are several ways to implement the timing of the execution of theemulation processing. In one embodiment, a timer on the system (derivedfrom the host system clock or some other source) can be used to triggerthe processing. In another embodiment, the haptic feedback device cangenerate messages at a specific time interval which are sent to the hostsystem to trigger the emulation and to trigger the emulator to sendforce values to the device.

However, when communications interfaces that have built in support forfixed period streaming channels are used, it is far more efficient tocontrol the timing of the emulation based on the communication channel.The emulator 110 preferably works to try to keep the streaming channelfilled with data to be sent to the device. In some operating systemimplementations (e.g., Windows), it is also a requirement that streamingchannels are continuously filled with data after they are initiated. Aseach streaming request is completed, the emulator is triggered togenerate new data to be sent to the device.

FIG. 3 is a block diagram 130 illustrating communication between theemulator and the operating system (OS) communication driver of the hostsystem in one embodiment. If the operating system or device driver forthe host controller is capable, it may be possible to submit severaltransfer requests to the lower level driver that are queued to betransmitted to the device sequentially in a streaming fashion. This isimportant when operating under an operating system, such as Windows,where the emulator layer may be delayed too long in submitting astreaming transfer request due to the emulation layer processing torefill the translation layer. The processing delay can be caused byother processes running on the host system which use host processingtime, such as disk drive drivers, audio drivers, communication (e.g.network) drivers, etc. If such other processes are running at an equalor higher priority to the emulation layer, then the refill processingcan be delayed. Thus, by having multiple requests pending in thecommunication driver, the emulation processor will have the time that ittakes to completely transmit one transfer request in order to refill theother transfer request for transmission.

As shown in FIG. 3, the emulation process can provide two transferrequests, A and B. In the startup processing at stage 132, TransferRequest A is provided to and begun to be processed immediately by thecommunication driver (e.g., to output data to the device), while RequestB is provided to the communication driver during the processing ofRequest A. When Request A is complete, the communication driverindicates this completion to the emulator with a trigger, and theemulator begins runtime processing (refilling) of Transfer Request A atstage 134. Meanwhile, after it has sent the trigger to the emulator, thecommunication driver processes Transfer Request B. During the processingof Request B by the communication driver, the emulator finishesrefilling Request A and provides the Request A to the driver. When thecommunication driver finishes Request B and triggers the emulator, thedriver can then process the refilled Request A and the emulator canbegin refilling Request B at stage 136. The runtime processes repeat toallow delays to have minimal effect in streaming data to the device.

The implementation of the trigger to cause the emulator to performsubsequent computations (such as refilling a request) can beaccomplished in many ways. One way is to include an interrupt responseroutine that is executed when the transfer to the device is completed.However, in most operating systems, the host controller driver(communication hardware) handles interrupts, not the communicationdriver, so the interrupts are not exposed high enough to be acted uponand thus the interrupt option is often unavailable. In a differentembodiment, a callback routine can be executed when the communicationdriver has completed the transfer. However, callback routines executewith very high priority. If the callback routine takes an excessive timeto complete, some other processes could be starved of processing time.Furthermore, since the callback routine is at an elevated priority, itmay not be able to access all the memory it needs (aged out) or use allthe system services, e.g. it may be too high a priority to be able toaccess paged memory which is intended for lower-level priorityprocesses.

A preferred implementation provides an execution thread (on amulti-threaded system) that is awakened from a suspended state by asynchronization object indicating that a pending transfer is completed.This implementation does not have the restrictions of a callbackroutine, as is well known to those skilled in the art.

Processing Sharing

When an emulation driver is being used for a device, it enables a widespectrum of “loading sharing” possibilities. These possibilities canrange from the emulation driver performing essentially no processing(for a highly capable and sophisticated device) to the emulation driverhandling all the force effect computations and sending only a raw forceoutput to the device (for a simple device). As more of the processing ishandled in the emulation driver, the processing power of themicroprocessor used in the device can be increasingly reduced. Forexample, if the emulation driver handles substantially all forcecomputation, the microcontroller on the haptic feedback device can be assimple as a state machine or simple logic circuitry. However, for avariety of reasons, the most effective and preferred solution is onethat divides the force effect computation/processing between the hostsystem and the device based on the type of the effects being generated.This sharing of the processing presents a few issues that must be dealtwith.

Effect Types

As described above, haptic sensations can be commanded in many hapticsystem embodiments by the host computer with high level commands. Thehigh level commands are formulated by the host computer based on eventsor interactions occurring in an application program on the hostcomputer, or based on other events or instructions. The high levelcommands are sent to the haptic feedback device and are parsed ordecoded by the local microprocessor on the haptic device. The localmicroprocessor implements the commands by performing any necessarycomputations, and outputs an appropriate force effect at an appropriatetime, as dictated by parameters or instructions sent with the commandand/or any instructions associated with that command as stored in thememory of the haptic feedback device.

When controlling haptic feedback devices, the force commands that aresent to the device are commonly executed as “effects”, “force effects”,or “haptic effects” which herein is used to indicate any type of forcesensation, i.e., each effect is a description of a force sensation to beoutput by the device, and these terms may describe a single force outputon the user or a series, sequence, or combination of many forces overtime and/or space. A force sensation is represented by the effect'sparameters; some parameters can be common to all effects. These mayinclude parameters such as the effect type, the duration of the effect,and button triggers that can be associated with the effect. Otherparameters may be specific to the type of effect. For example, aconstant effect needs only a single additional parameter to describe itsmagnitude. However, a periodic force effect such as a sine wave mayrequire several other parameters for a complete description, such asmagnitude, phase, period (frequency), and offset.

When dealing with effects, it is often convenient to group them into twocategories. The first group of effects would be those that provide aforce primarily based on time. These effects would include such types asconstant forces (e.g. pulses or jolts), periodic forces (e.g.vibrations), or sampled force outputs. The important feature that theseeffects share is that they are all completely independent of the sensedmotion measurements on the device. No matter how the device ismanipulated by the user, the force output for these effects will be thesame. These effects are classified herein as “open loop” effects.

The other group of effects includes effects providing a force that isprimarily based on a, position (or velocity, acceleration, or“jerk”—derivative of acceleration, which are all based ultimately onposition) of a user manipulatable object of the device. These effectsinclude types such as springs, dampers, and spatial textures. The forceoutput from these effects is directly related to the motion that occurs,and which is sensed, on the device. Because the force output from theseeffects is generated by a sensor feedback (servo) loop on the device,they are called “closed loop” effects herein, and can also be referredto as “conditions.” Some devices may not be able to output kinesthetichaptic effects that provide resistance to a user object or housing inits degrees of freedom, but may still be able to output closed-loopforces that are dependent on user object or device position, Forexample, some tactile devices may output forces on the housing of adevice but cannot output resistance forces in the degrees of freedom ofmotion of a manipulandum or the device.

Actual Processing

When creating an emulator processor to operate on behalf of a device, ithas been found that “open loop” types of effects are very goodcandidates for processing by the emulation layer. These types of effectsare generally a function of time only and the force value content ofthese force effects is not based on changing manipulandum positions inreal time. Because of this, the emulation layer (or other host layer)can easily compute the force output for each effect at the current timeas well as in advance for all times until the effect's completion. Thisallows the computation of a buffer of force values into the future thatare simply fed into the streaming channel to the device. This allows thehost system to emulate these types of effects without any degradation inthe quality of the effect generation and without requiring any deviceprocessing.

“Closed loop” types of effects are far more complicated. These effectsare strongly dependent on the sensor values that are measured on thedevice itself. If the emulation layer on the host system is going tocompute the force output for these effects, the data from the sensorreadings needs to be transferred from the device to the host systembefore the force effect can be computed. This presents several issues:

-   -   1. The input reporting of the device sensor data to the host        should not be accomplished through a streaming channel. It could        be performed this way, but it greatly increases the burden on        both the host and device systems.    -   2. “Closed loop” effects cannot be accurately computed for        future time values. This results from the fact that it is        usually not possible to accurately predict the motion of the        user manipulandum when the user is interacting with it.    -   3. As the delay between reading a sensor value and using the        data in a computation of a “closed loop” effect increases, the        stability and quality of the effect execution is greatly        decreased. This is because closed loop effects are essentially        small servo loops requiring rapid updates to maintain quality of        feel and prevent instability.    -   4. Generally the operating system or communication device driver        requires the output streaming channel to be continuously filled        (see discussion above). Because of this, at least two transfer        requests frequently must be kept pending to the device at all        times (or the requests are interleaved at least part of the        time, as shown in FIG. 3). The requirement of multiple pending        transfer requests can greatly increase the latency between the        time the effect force values are computed and the time where the        force values are actually transferred to the device.

As a result of these factors, the quality of “closed loop” effects thatare emulated from the host system will be significantly lower than ifthe effects are actually computed on the device itself. Because thisreduction in quality is very perceptible to a user, it is often moreattractive to compute the outputs for closed loop effects on the deviceitself using a local microcontroller such as a microprocessor.

These factors lead to a preferred embodiment of the hybrid system of thepresent invention where the actual processing is shared between the hostsystem and the device based on the types of effects being generated.Those effects that are directly dependent on the sensor values in thedevice are computed on the device, while those effects that areessentially time dependent are processed by the host system. This leadsto the shared processing, or hybrid, system architecture. Herein, theterm “host effects” indicates those effects to be computed on the host(e.g. by the emulation layer), and the term “device effects” indicatesthose effects to be computed on the device (which are closed loopeffects in a preferred embodiment).

In a preferred method, the application program sends haptic commandsdown through the hierarchy of host levels as shown in FIG. 2, e.g. acommand to output a force as commanded by the application program 102can be translated to the appropriate forms to each successive layer ofthe host operating system. At some point, the emulation layer receivesidle command. Since the emulation layer is emulating a device, the layerabove the emulation layer believes it is outputting the haptic command(or other device command) to the device itself. The haptic commands canbe such instructions as: “create” to create a new force effect (and itsparameters) in the memory of the device; “parameter” command to load oneor more new parameters in device memory for a loaded effect or otherwisemodify a loaded effect; “destroy” to remove an effect from devicememory, “play” to output a particular effect stored in device memory; orother instructions that may instruct the device to delay the output of aforce effect by a designated time period, combine two or more forceeffects, or perform other tasks.

If a particular command is for a device effect, then the emulation layersends the command to the device so that the local microcontroller canstore the effect and compute force values at the time of output (orbefore output, if the device has enough memory to store force valuedata). If a command is for a host effect, then the emulation layerprocesses the command. For a create command, the emulation layer canstore the created effect in a device memory model provided in hostmemory, as explained below. The emulation layer can compute force valuesfor host effects in one of two ways (or a mixture of these methods toachieve more efficiency). In a first method, the emulation layercomputes force values when a “create” command or a parameter command isreceived from an application program. The force values are then storedon the host until they are commanded to be played, at which point theyare sent out to the device. In a second method, the emulation layer cancompute the force values when a “play” command is received, where theforce values are sent out to the device (or buffered) as they arecomputed. If the device computes force values when a create or parametercommand is received, there is a possibility that the effect is neverplayed, and the computation would have then been wasteful of processingavailability of the device. However, if the force values are computed atthe time of playing the command, performance will be slightly less dueto the computational resources required at the time values are output.Once the emulation layer computes the force values, they are streamed tothe device to be output in real time, as described above.

Some effects may be a combination of the sensor based computations andother computations. For example, it may be possible to command a dampingforce that is only active when the device is operating in a specificrange of its motion. Thus, for example, the computation of a force valuefor the damping force is based on the current velocity of the usermanipulandum, and whether the damping force is to be computed at all isdetermined by the location of the manipulandum, e.g. whether themanipulandum is in a predefined damping region of the deviceworkspace/displayed graphical environment. In such a case, “hybrideffects” can be used, where the emulation processor may partially assistthe device in handling the output. For example, in one embodiment thedevice may be capable of generating that damping force output, but maybe unable to gate (turn on or off) this damping output based on theposition of the device. In this instance, the emulator can, for example,interpret input position reports that are received from the device anduse this information to turn the damping force on and off. This allowsthe damping effect output to remain stable (and have good quality) andstill only be effective in the region of interest without having thedevice perform unnecessary processing to determine the location of theregion of interest and determine when to output effects.

It may sometimes be desirable to handle the all the force computations,including closed loop effects, on the host system even though there is agreater reduction in the quality of haptic feedback sensations. Thisembodiment leads to the greatest reductions in the processing powerrequired for the device microcontroller and therefore the greatestreduction in device cost. In this type of design, efforts must be madeto limit, as much as possible, the delay between reading the sensor dataon the device and generating the force output requests. One method tohelp reduce this lag is the introduction of an input streaming pipe tothe communications. This pipe allows the device to send informationabout its sensor values very rapidly and very often to the host system.Isochronous transmissions, for example, are intended for this type oftransfer. This type of communication channel helps to reduce the lagintroduced on the inbound transfers from the device.

However, even with the input streaming channel, there is still a delayin the output channel. One of the primary contributors to this resultsfrom the need to keep the output streaming channel full of data. Theremay be a way to minimize this delay, but it is not likely to be an“approved” method, i.e. it may not be according to established standardsor may not be robust in some applications. One way this would work is tomodify or update data after it has been submitted to the communicationdriver.

Once a transfer buffer has been submitted for transfer to the device, ittechnically no longer belongs to the haptic feedback driver. However, itmay still be feasible to modify the contents of the data buffer eventhough the haptic feedback driver has relinquished the data. This mayallow the haptic feedback driver to update the streaming data with farless latency before it is sent to the device. In this way, lower overalllatency and improved performance for closed loop effects may beachieved.

For example, FIG. 4 is a block diagram 150 showing one such embodimentof modifying the buffer. Initially, a Transfer Request A and B aresubmitted, as shown in FIG. 3 (not shown in FIG. 4). At time T1 of FIG.4, a request to refill buffer A with a new Transfer Request A issubmitted by the communication driver to the emulation layer whileTransfer Request B starts to be processed by the communication driver.The emulation layer begins to refill Transfer Request A. At time T2,sensor data from the device is reported to the host computer describingthe position (and/or velocity, etc.) of the user manipulatable object onthe device, and the communication driver receives this sensor data andsends it to the emulation layer. The emulation layer processes thereceived sensor data to determine if the already-submitted force valuesin buffer B should be modified to correlate with the sensor data. If so,buffer B is modified accordingly. Buffer A is not so modified, however,since it is currently being refilled with a new transfer request untiltime T3. At time T4, Transfer Request B is still being processed andoutput by the communication driver, and sensor data is again receivedfrom the device. The emulation layer determines if data in both buffer Aand buffer B should be changed in accordance with the sensor data. Bothbuffers may be changed since no refill processing is occurring by theemulation driver. Addition changes to the buffers can be made atadditional time points, such as time T5.

At time T6, Transfer Request B has finished processing by thecommunication driver, and the communication driver indicates this to theemulation layer. The emulation layer begins refilling Transfer Request Bin buffer B while the communication driver begins processing andoutputting Transfer Request A. Similarly to time T2, at time T7 sensordata is received, and only buffer A is updated if appropriate sincebuffer B is being written to. At time T8 the refill operation iscomplete, so that at times T9 and T10 when sensor data is againreceived, both buffers A and B may be modified if appropriate.

Hybrid Control of Open-Loop Forces

As described above, an implementation of a “hybrid” system provides thehost computer to compute some types of force values and stream thevalues down to the device, so that the device simply outputs the forcevalues to the actuators of the device to provide force output. The hostcan stream die data to the device using, for example, a serialcommunication bus such as USB or the like, or other type ofcommunication link or channel. The local microprocessor, however,computes force values for other types of force sensations and controlsthe actuators without any need of further host computer processing oncea high level host command is received. In a preferred embodiment, thehost computer determines and streams force values to tie device foropen-loop, primarily time-based effects, while the local microprocessorcomputes and controls output forces for closed-loop, position-basedeffects.

Another aspect of the present invention can divides the tasks of thehost computer and local microprocessor yet further. Instead of the hostcomputer determining and streaming all open-loop force effects, the hostcomputer can only determine “low frequency” open-loop effects and sendthose effects to the device. “High frequency” open-loop effect forcevalues are determined and output by the local microprocessor, once acommand from the host computer has been received by the localmicroprocessor instructing the output of the high frequency effect. If aparticular embodiment also provides closed loop effects such as dampers,springs, and spatial textures, then those effects are preferablycomputed and controlled by the local processor (although in alternateembodiments, some or all of such closed loop effects can be provided andstreamed from the host computer).

The control of high frequency open-loop effects may in many embodimentsbe more appropriate for the local microprocessor to handle than thehost. Since the force values in a high frequency effect are changingrapidly, the host computer may not be able to send the values across thecommunication link to the device as quickly as desired to maintain thefidelity or frequency of the effect. This may especially be the case ifa low-bandwidth or high-latency communication link between host computerand interface device is used. Low frequency open-loop effects, however,are changing more slowly and thus allow force values to be streamed moreeffectively from the host system across the communication link to thedevice.

One way to determine the difference between “low frequency” and “highfrequency” open-loop effects, in a described embodiment, is to comparethe frequency of a force effect with a predetermined thresholdfrequency; those open-loop effects having a frequency below thethreshold are “low frequency,” and those having a frequency above are“high frequency.” For example, an application program running on thehost computer might determine that a 200 Hz periodic vibration (anopen-loop effect) is to be output by the haptic feedback device. Adriver or other program on the host (e.g., the “emulation layer” asdescribed above) can compare the frequency parameter of the commandedvibration to the threshold frequency, which might be set at 50 Hz, forexample. Since the effect's frequency is over the threshold, the effectis considered a high frequency open-loop effect, and therefore thecomputation of the force values for the effect is performed by the localmicroprocessor. The driver thus simply sends a high level vibrationcommand to the local microprocessor with appropriate parameters, and thelocal microprocessor decodes the command, computes the force values foroutput, and sends those values to the actuator(s). If the frequency wereunder the threshold, the emulator (or other program layer on the host)knows that the host should be computing the force values and streamingthem to the device for output, and does so as described above. In otherembodiments, the distinction between low frequency and high frequencyopen loop effects can be determined in other ways or according todifferent or additional criteria. For example, a command or parameter ofa force effect might directly designate that effect as high frequency orlow frequency, as predetermined by a developer or user.

This division of labor between local microprocessor and host computerallows the local microprocessor to be reduced in complexity andtherefore leads to a reduced cost for the haptic feedback device. Forexample, in some types of haptic devices, the local microprocessor canbe simplified to handle only one force effect at a time. Since the hostcomputer can stream, data to the local microprocessor at the same timethe local microprocessor is controlling its own force effect, twosimultaneous force effects can effectively be output, even with such asimplified local processor. For example, one common force effect intactile devices is the simultaneous (superimposition) of two vibrationeffects, one vibration having a high frequency and one vibration havinga low frequency. In the present invention, such simultaneous output oftwo vibrations is possible even when using a simplified processor, wherethe local microprocessor computes the content for the high frequencyvibration and the host computes and streams the content for the lowfrequency vibration. Similarly, the host can stream a low frequencyopens loop effect simultaneously with the control and output of aclosed-loop effect handled by the local microprocessor in those devicescapable of closed-loop effects. Preferably, the local microprocessorperforms a summation of locally-determined effect values and forcevalues received from the host computer to determine a final total forcevalue to output from the actuator(s) of the haptic interface device.

It should be noted that other types of force effects can be selectivelyhandled by the host computer in a hybrid embodiment, if desired. Forexample, the host computer might be designated to compute and streamforce values only for obstruction and/or texture closed-loop forceeffects, or for all closed-loop effects, as well as the low-frequencyopen-loop effects described above. The computation of force values forother subcategories of effects can be divided between host and localmicroprocessor as desired.

In other embodiments, the interface device need not have the capabilityof outputting closed loop effects such as springs or damping. Forexample, many tactile devices such as particular gamepads or mice canonly output vibrations or pulses to the user through the housing, andspring and damping forces in the degrees of freedom of the usermanipulandum cannot be output. The present invention is still applicablein such an embodiment, where the host streams force values for lowfrequency vibrations and the local microprocessor computes force valuesfor high frequency vibrations. For example, gamepad tactile devices ormouse tactile devices moveable in a planar workspace can be used inhybrid systems, such as those disclosed in application Ser. Nos.09/456,887 and 09/585,741, incorporated herein by reference in theirentirety.

Device Memory Handling

Device memory management becomes important when providing hapticfeedback effects, since the memory on the device is typically limited insize, thereby limiting the type and number of effects which can beoutput by the device. When using an emulation layer, however, theemulator can potentially use the relatively large amount of hostcomputer memory to store effects. Thus, if some effects are processedand stored by the emulator while some effects are processed and storedby the device, issues arise as to when an effect can be played and whenan effect will not be played due to memory restrictions.

For the consumer haptic feedback devices available at present, there aretwo memory management methods in use. The first is a “host-managed”method. For the devices that support this method, the device willindicate how much memory it has available and the host system is thenresponsible for dealing with the allocation and usage of this memory.The host maintains a model of the device memory in host memory and canthus determine when device memory has space available for new effects,what effects are currently playing, etc. This saves communicationbetween device and host since the host knows when new effects can beloaded to the device without having to request and receive a memorystatus update from the device. This type of method is described ingreater detail in U.S. patent application Ser. Nos. 08/970,953 and09/305,872, both of which are incorporated herein by reference in theirentirety.

The other method is “device-managed” method, in which the host does notmaintain its own model of device memory. Devices that support thismethod of operation require that host request an allocation of memory onthe device for each effect that is created. The device receives therequest and, if there is memory available, assigns a handle or ID numberto the created effect and then provides that ID value to the host (suchas the haptic feedback driver or application program) so that the hostcan reference and command that effect in device memory (to play it,destroy it, etc.). The host is also responsible for communicating to thedevice when the host no longer needs the memory for each effect. Whilethe host managed architecture requires some extra processing by the hostsystem to keep track of the device memory, it greatly reduces thecomplexity and volume of the communication with the device as well asthe complexity of the device itself when compared with a device managedarchitecture.

If the emulation driver is operating on behalf of a device that supportsdevice managed memory for its effects, then there are no realcomplications for a hybrid system. In this case, the device will informthe host when enough memory is available for an effect being created onthe device and when memory is full. The emulation layer can receive thedevice messages and simply relay them to a higher level program, such asa haptic feedback driver or application. Thus, the emulation layer canallow device-effect requests to transfer to and from the device withoutany changes, i.e., no changes to those effects that the emulation layeris not processing and implementing. For host effects that the emulationlayer is implementing, the emulation layer needs to provide the handleor identification (ID) values to identify the host effects.

The main complication is that the emulation layer needs to ensure thatits memory ID values do not overlap with the values the device is using.This overlap can easily be avoided by having the emulation layer “wrap”all the ID values to make sure no values overlap, and perform sometranslation for the messages that are actually sent to the device toavoid the overlap. For example, if the emulation layer assigns a hosteffect an ID of 2, and then the device assigns an ID of 2 to a deviceeffect, there may be an overlap problem. The value for the host effectcannot be changed since in typical embodiments there is no method fortelling the haptic feedback driver (or application) that the ID has beenmodified. Instead, the emulation layer can map the ID of the deviceeffect to a different “mapped” ID, such as “n,” which is reported to theupper level driver and to the application in some form. When messagesfrom the upper drivers or programs reference an effect having an IDvalue of “n,” the emulator can look up the n value (e.g. in a look-uptable) and determine that it identifies the device effect having adevice ID value of 2. The emulator then modifies the message before itis sent to the device so that an ID value of 2 is used and so that thedevice can reference the correct effect in its memory. Such mappings canbe handled in a variety of ways, including providing special valueswhich are known to be mapped, or mapping all values.

A more difficult situation exists when an emulation driver is used toshare the processing with a device that supports the host managed model.The problem is that since some of the effects are actually implementedby the device itself, the emulation layer can't report that the devicehas any more memory than is actually available on the device withoutrisking an invalid effect creation. If, for example, a very limited orinexpensive device is being used which can store only a small number ofeffects, then to be safe the emulation layer would have to report thatonly the small amount of memory is available. Then the applicationprogram would never command more than the small number of effects whichcan be held by the device.

Thus, the emulation layer would like to report that it has a lot ofmemory available to store effects, since that is the case for hosteffects. However, if the emulation driver were to indicate that a largeamount of memory was available, there is nothing that would prevent thehost from locating the data for an effect in the upper portions of thatlarge memory space. If this effect were actually a device effect to behandled on the device, it would fail because the data memory associatedwith that effect is located outside the small valid range of the devicememory. The emulation layer could attempt to “remap” the effects thatare actually transferred to the device so that it would fit in devicememory, but this would lead to further problems. First, the emulationdriver would have a difficult time determining when device memory hasbeen freed and is available (unlike the device-managed memory model).This would prevent the emulation driver from doing any “cleanup”activities on the device memory. Also, since the host software cannotknow how much of the enumerated memory is actually available on thedevice, it could attempt to create more effects than the device cansupport. If all of these effects were device effects that needed to beloaded to the device to execute (e.g. they were closed loop effects),then it is impossible for this to occur. Because the host software wouldassume it has complete knowledge of the device, it would not be able toknow that the effect creations had failed.

One method of avoiding this problem is to allow the emulation layer tosimulate an interface using the device-managed method for the device. Ifthe emulation driver enumerates the device to the operating system inthis manner, then any software accessing the device will know to usedevice-managed communication methods to control the device. When hosteffects are created that are implemented by the emulation layer, theemulation processor will handle the allocating and releasing of whatevermemory it requires to implement the effects. If device effects arecreated, the emulation layer will need to handle the processing for thedevice memory management. In these cases, the emulation layer will berequired to remap the effect id values in outbound messages from thecontrolling software to the actual memory offsets on the device beforethe messages are sent to the device, since the device expects to receiveactual memory offsets and not effect id values. Even though the hostsoftware will need to execute the additional communication required fora device managed interface, this should not add any significant delayssince these requests are all handled in the emulation driver and do notrequire any actual communication exchange with the device itself. If toomany effects are commanded, the emulation layer will know this based onreceived device messages and can inform upper level programs that aneffect creation has failed.

Descriptor Processing

One trend that is becoming increasingly common for computer peripheraldevices is to provide the ability for peripherals to enumerate theircapabilities to the host system. When this enumeration is standardized,the host software can be made flexible enough that it will be able tohandle many different devices with different capabilities dynamicallywithout having to be programmed specifically for each device. An exampleof an existing standard that allows peripherals to enumerate theirabilities in this manner is the Human Interface Device (HID) Classspecification for USB devices. Using this specification, devices candescribe how they provide data to host systems and how they expect toreceive data in a very standard manner. The HID specification is furthersupplemented by other usage documents, such as the Physical InterfaceDevice (PID) Class specification for USB devices, which define otherstandard information, such as information related to haptic feedback,that devices can use in communications with host systems. Theinformation that describes the communication capabilities of the deviceis commonly called a “descriptor.”

When an emulation driver is used to enumerate a descriptor for a device,the situation is more complicated. Some devices may have no descriptorinformation at all. In these cases, the emulation driver needs toprovide a complete descriptor for the device. For this to occur, theemulation driver must be able to at least identify what device isconnected using, for example, standard vendor ID and product ID values.

If a haptic feedback device of limited capabilities provides itsdescriptor to the host system, it may enumerate only a small number ofreports. As a simple example, say the descriptor for the device onlydescribes two reports: one is the position input report from the deviceto the host (describing a position or motion of a user manipulatableobject) and the other is an output report received by the device thatallows the host to command raw forces to the device actuators. If theemulation layer is operating in this system, then the descriptor for thedevice must be changed (before it is reported to operating system) todescribe the further capabilities that are made possible throughemulation. If the emulation layer is made flexible to handle multipledevices, then it can be required to build the new descriptor that is tobe reported to the operating system. This new descriptor will need tocombine the input report information (describing the device's actualposition report) as well as the additional output reports (for thefunctionality that is handled by the emulation processor). Creating thisdescriptor will require that the emulation driver be able to extract atleast a portion of the descriptor that is returned from the device inorder to build the complete descriptor for the device that includes theemulated functionality. An alternative to this approach allows theemulation driver to generate the complete descriptor as it would have todo for devices that had no descriptor information, i.e., create a newdescriptor regardless if the device already provides a (limited)descriptor. The emulation layer still needs to extract relevantinformation from the reported descriptor; or, a “hard coded” descriptor(e.g. appropriate for the type of device, manufacturer, model, etc.)which is stored on the host accessible to the emulation driver can beused while ignoring any description information reported by the device.

Computational Methods

Because of the significant architectural differences between desktopcomputers and the microcontrollers commonly used in peripherals such asinterface devices, new methods for computing the force output areenabled. The microcontrollers that are commonly employed in most lowcost computer peripherals tend to be under serious cost restrictions.Because of this, they are not only limited in their processingcapabilities, but they are usually restricted to only a very smallamount of data memory (RAM). In order to maximize the number of effectsthat the device can store and play, each effect must be described usingonly a small number of control parameters. For example, a period type ofeffect (say a sine wave) might be stored on the device as only the datafor its magnitude, period, direction, duration, etc., rather than beingstored as a series of points or values, which requires much more memory,From the stored parameters, the device computes the force value at eachtime step of its playback by knowing how much time has expired for theeffect. While this functions correctly, the device will end up computingthe same force values several different times if the effect is playedfor a time that is longer than its period.

The host system is not generally subject to the same constraints as thedevice microcontroller. In addition to having much more processingcapacity, the host system also contains far more memory (RAM). This mayallow the host processing to be more efficient. Instead of recalculatingthe same values multiple times (e.g. for each period of a periodicwave), the host can compute the repeated values once and store theresult; a stored value can then be quickly retrieved for the next timeit is required to be output or otherwise used. In order for this methodto operate effectively, the effects that are being computed must berepetitive over time.

One way this computation/storage can be handled is by performing thecomputations for each time step of the period as they occur during thefirst period of the effect playback, e.g. a cycle of computing a value,storing the value, and outputting the value to the device, and thendoing the same for each successive value of the initial period. Assubsequent periods of the effect are repeated, the stored values can beused to generate the output. An alternative approach would be toprecompute and store one entire period of force values for the effectwhen the command to load the effect parameters is received from the hostsoftware. Then, during output, stored values are retrieved, even for thefirst period of the effect. This method can reduce the chance of thehost missing an output period during the first effect period, but maysignificantly increase the time required to process the outboundmessage.

Another issue with this computation approach is that the processing foran effect may need to include some combination of retrieving a storedvalue for the given time step and a real time computation to get thefinal force output value. This would be the case, for example, whencomputing the output of a periodic effect that has an envelope applied.An envelope is a modification of a force effect based on a desired“shape” that the developer wishes to obtain, e.g. a ramp up and rampdown (fade out) at the begin and ends of a periodic waveform. While thefrequency/period of such a periodic effect remains the same, theenvelope alters the magnitude of the effect at different points in timeduring the effect. In such a case, the raw values used in thecomputation of the periodic output could be precomputed or stored duringthe first period of execution. However, if the effect had anysignificant duration, it would be very costly (in terms of memoryrequirements) to compute and store the force values for the entireeffect.

While storing the force values for a single period of an effect willhelp reduce the processing load on the host system, there are also othermethods that can be used to reduce the processing. One method is to havea variable computation rate for different effects, e.g. different typesof effects (vibration vs. spring force, etc.), different frequencies ofeffects, etc. For example, a high speed periodic effect, such as a 100Hz sine wave, would require very rapid force computations in order toachieve high quality force output. However, a slower periodic (or othertype) effect may not require such rapid computations. When processing aneffect, the emulation layer can be designed to adapt its processing ratefor each effect. For a slowly changing force effect, less computationscan be made for every unit of time, i.e., there can be more time elapsedbetween successive computations. This will result in a reduction ofprocessing loading on the host system without a degradation in theoutput quality.

If the adaptive processing rate method is combined with the storage ofsamples for one effect period, the usage of memory on the host systemcan also be reduced. For example, say that a ½ Hz sine wave force is tobe produced. If the output for this force were to be computed everymillisecond, then 2,000 sampled points would be needed to define asingle period of the effect. However, if a new force sample is computedonly every 8 milliseconds, then only 250 samples need be computed andstored to describe the complete effect. In systems where the resolutionof the force commands is low (say, 8 bit values), there would be noperceptible degradation in the quality of the force output. When thecomputation rate is changed for an effect, this rate must be kept trackof for each effect in order to know for how long each force sample valueshould be applied.

Dual Mode Devices

With the possibility of force value streaming, a device is enabled thatcan handle two modes of functionality. In the first mode, the devicewould handle all of the effect processing. If a microcontroller used inthe device is scaled back from those typically used incurrently-available devices, then this device would potentially havereduced capabilities and performance from the current devices. Thus, forexample, the device may have less memory and thus can output fewereffects at once and/or fewer types of effects, and the force sensationsthat are output may have less quality or realism. However, in this mode,the processing requirements on the host computer would be minimized.

In the second mode of operation, the device can be enabled for hybridoperation. It is still enabled to handle all the effects processing thatit could handle in the first mode, and would also be able to acceptstreamed force information from the host system. The host emulationprocessor could then work to balance the force processing effectivelybetween the host processor and the device. This can increase thequantity (in terms of the number of concurrent effects) and quality ofthe force output that is possible with the device. In some embodiments,the division of the processing between the host system and the devicecan be varied in this mode. This variation may be controlledautomatically by the emulation driver (with the emulation driver cappingits consumption of host processor usage), a different driver, or by ahost application program, or through a user preference or softwaresetting.

A central ability of the dual mode device is to be able to effectivelybalance the force processing distribution in such a way that the outputquality is maximized while the impact on the host system performance isminimized. Some characteristics, parameters, and other aspects of thesystem that can be adjusted to achieve this balance include the timegranularity of the effects output on the device (effects having lesstime per successive force output have greater resolution and greaterquality but require more processing); the host processor loading (thehost may be able to compute some or all of a particular type of forceeffect, relieving the device microprocessor but potentially adding delayand loss of quality); and device capability consideration (differentdevices have different capabilities and some may be able to particulareffects better than other devices based on the hardware of the device).Some of these balancing methods, such as the time granularity of forces,could be balanced in all hybrid systems.

In some embodiments, the balancing can be performed automatically bylower level host software such as the emulation layer which can examinea device's capabilities using the descriptor or other informationreceived from the device, examine current host processor loading, orother factors to arrive at a balancing level. Also, an applicationprogram or high level driver could handle the balancing. For example, agame program might only use certain types of effects which are simpleand of generally high quality, and thus the processing loading on thehost can be reduced. In addition, the balancing can be adjusted by theuser through a software interface control panel or the like, where theuser may desire a certain level of quality and host performance in aparticular application or in general.

Another characteristic of the haptic feedback system that can beadjusted in some embodiments to balance processing is the period of thestreaming data sent from host to device. The streaming data can, forexample, be sent once per millisecond to the device to be output, or canbe sent 8 times per millisecond. The smaller the period, the greater thefidelity and quality of the force sensations based on that data. Toprovide balancing, the host can preferably select one of a plurality ofdifferent periods at which to send the data, based on factors such asthe processing load of the host and the capabilities of the device. Forexample, if the host is particularly burdened with processing at aparticular time, then the emulation layer (or other driver) can select alonger period, thus causing lower quality haptic feedback to be outputbut reducing the processing burden on the host. On the other hand, if aparticular system has a high bandwidth interface between host and deviceand the device is more sophisticated, then a lower period can beselected to increase the quality of haptic feedback. In someembodiments, a device can send information to the host to indicate atwhich speeds/periods it may receive data, and the host driver can selectfrom the available periods. Also, the host application and/or user canin some embodiments select particular streaming periods or provideconditions to adjust the period.

Caching

Another feature that may be enabled by emulation processing is “effectcaching.” This type of caching allows the host computer to store someeffects which have been commanded to be output to the device when thedevice's memory is full. Since the host usually has more memory than thedevice, the host can store (cache) effects, at a low hierarchical level,which the device is not able to store and can send the cached effects tothe device when they are to be played or output. In this scheme, theapplication program and other higher software levels believe that thecached effects have been created and stored on the device. This requiresless memory to be provided on the device and reduces device cost. Thismethod is described in greater detail in patent application Ser. No.09/305,872, which is incorporated herein by reference in its entirety.That application discussed implementing effect caching at a higher levelthan the preferred level for the emulation layer described herein;however, there may be some significant advantages to performing theactual implementation of effect caching at the lower level of theemulator; for example, there is less computational overhead whencommunicating with the device. If the emulator is implementing theeffect caching, then the device preferably appears as “device-managed”(rather than using the host-managed method) to the operating system toeasily allow the emulation layer to handle the processing for deviceeffects as explained above.

Recovery from Data Transfer Errors

Most of the following embodiments are related to gracefully handling therecovery for data transfer errors or crashes of the host system duringhaptic feedback operation.

Interpolation for “Missing” Force Streaming Reports

When the host system is performing emulation for a haptic feedbackdevice using a serial data bus to transfer the data, there is a strongpossibility that some of the messages that are sent from the host to thedevice may be corrupted. When the device receives a corrupted packet, ithas no choice but to reject any data that may be included in themessage. This can happen to any type of transfer messages, but itrepresents a more significant issue when messages are transferred usingan isochronous data channel. Since isochronous data channels aredesigned to favor timely delivery of messages as opposed to a guaranteeddelivery without errors, messages sent on this channel are not resent ifan error occurs.

Because of this lack of resending ability, there will be situationswhere the device needs to generate a force output for a new time stepwithout having received new (or uncorrupted) data from the host system.There are several different methods the device can employ to generate aforce on such occasions. One of the simplest methods to handle this isfor the device to simply reuse the last force value it received. In manycases, this will work without a problem. If the time variance of theforce output is slow relative to the period between force streamingvalues, then the force samples will be close to one another and the userwill not detect that an error has occurred. However, if the force valueis changing rapidly relative to the force steaming period, using thismethod will result in a discontinuity in the effect output. At aminimum, this will result in an incorrect effect output on the device.In addition, this behavior may actually decrease the stability of thesystem. For example, if an output force effect has a high frequency anda high magnitude, then missing samples can generate unintended longerperiods in the output force waveform.

One alternative to outputting this discontinuity is to have the deviceextrapolate the force output based on the last series of force values itreceived. In this case, the device may be able to closely estimate theforce values for those times that it receives corrupted data from thehost system. This would help reduce the discontinuity of the forceoutput on the device. For example, if the device were receivingsuccessive values in an arithmetic or geometric series (or approximatelyso), the device could determine the next value in the series.Alternatively, especially if successive values are based on a morecomplex relationship, the host can transmit a delta value to the device,which the device applies as a time step (or adds to a time step) until aflew delta value is received from the host.

Redundant Data Transfers

An alternate approach to handling missed or corrupted data transfers isto encode redundant data into each of the streaming data packets. If,for example, force output values with a period of 1 ms are streaming,then size of each packet that is sent can be doubled, and the forcevalues for this millisecond as well as the force values for the nextmillisecond can be included in each packet. Then, if the message for thenext millisecond were corrupted, the device would be able to use thedata that was sent in the previous data packet to get the correct forceoutput without discontinuity. This method is described in greater detailin U.S. Pat. No. 5,959,613, which is incorporated herein by reference inits entirety.

Device Shutdown if Stream is not Maintained

Another consideration when using force streaming is that the host systemway experience a failure after it has commanded a force output to thedevice. When this happens, the device may be left in a state where thelast command received from the host system commanded a non-zero outputand the device will be generating a force output. Since no more commandswill be received from the host system until it restarted, the outputforce may remain indefinitely. This can present safety problems for theuser if the output force is strong, or present problems for the device,such as overheating of actuators.

In order to prevent this situation, the device may implement an internaltimer that may only allow each force sample to remain active for a shortperiod of time. As new streaming messages are received from the hostsystem, this timer can be continually reset. As long as the timer periodis longer than the actual period between received force samples, thedevice would continue to generate the force outputs. However, if thistimer were to expire before a new force value is received, then thedevice would detect this as a communication failure with the host systemand the force output would be terminated until new messages are receivedfrom the host system.

Furthermore, once communication is reestablished and force outputresumed, the force can be “ramped” up smoothly from a zero or low valueto its original value to avoid any sudden jump in force magnitude to theuser. Such a ramping force is described in greater detail in U.S. Pat.Nos. 5,734,373 and 5,691,898, both incorporated herein by reference intheir entirety.

Streaming Processing with Devices Having Kinematics

Some of the more complicated haptic feedback devices have relativelycomplicated kinematics, where complex mechanisms are required in orderto generate efficient force output to the user. The kinematics equationsallow motion of various members of a mechanical linkage connected to theuser manipulandum to be translated into motion of the manipulandum indesired degrees of freedom, such as x, y, and z directions. For example,the mechanisms described in patent application Ser. No. 08/965,720 is arelatively simple mechanism requiring kinematics. The mechanismdescribed in U.S. Pat. No. 5,828,197 is a much more complicated devicerequiring complex kinematics.

One aspect of the device processing that would likely not shift to thehost system or emulator is the kinematics processing. Instead, all thedevices can handle their own kinematics computations and exchange dataand commands with the host system using only Cartesian coordinates (orany other required coordinates). While this does require more localprocessing power for the microcontrollers on complex devices, thebenefit of this approach is that the host software sees a uniforminterface no matter what devices are connected to the systems.

While this invention has been described in terms of several preferredembodiments, it is contemplated that alterations, permutations andequivalents thereof will become apparent to those skilled in the artupon a reading of the specification and study of the drawings,Furthermore, certain terminology has been used for the purposes ofdescriptive clarity, and not to limit the present invention. It istherefore intended that the following appended claims include all suchalterations, permutations, and equivalents as fall within the truespirit and scope of the present invention.

1. An apparatus, comprising a processor configured to: determine aclosed loop force value, receive an open loop force value, and output aforce signal based at least in part on the closed loop force value andthe open loop force value.
 2. The apparatus of claim 1 wherein theprocessor is configured to receive the open loop force value from a hostprocessor.
 3. The apparatus of claim 2 wherein the processor isconfigured to receive the open loop force value from the host processorby way of isochronous data transfer.
 4. The apparatus of claim 3 whereinthe processor is configured to communicate with the host processor via aUniversal Serial Bus.
 5. The apparatus of claim 1 further comprising: amanipulandum moveable in at least one degree of freedom, an actuatorcoupled to the manipulandum, the actuator configured to output a forceeffect to the manipulandum in response to the force signal.
 6. Theapparatus of claim 5 further comprising a sensor configured to detect aposition of the manipulandum in the at least one degree of freedom, theclosed loop force value being associated with a closed loop force effectdetermined based at least in part on a sensor signal output from thesensor.
 7. The apparatus of claim 6 wherein the closed loop force valueis associated with at least one of a spring force, a damping force, anda texture force.
 8. The apparatus of claim 5 wherein the manipulandumcomprises one of a joystick, a mouse, a trackball, a stylus, a steeringwheel, a knob, a button, a gamepad, a gun-like targeting device, a handgrip, and a medical instrument.
 9. The apparatus of claim 1 wherein theopen loop force value is associated with an open loop force effectreceived from a host processor.
 10. The apparatus of claim 9 wherein theopen loop force effect comprises at least one periodic force.
 11. Theapparatus of claim 1 wherein the closed loop force value is associatedwith a high-frequency force effect, determined based at least in part ona command from a host processor.
 12. The apparatus of claim 11 whereinthe open loop force value is associated with a low-frequency forceeffect provided by the host processor.
 13. The apparatus of claim 1,further comprising an actuator in communication with the processor, theactuator being configured to receive the force signal from the processorand output a force effect.
 14. A processor-executable program stored ina computer-readable medium, comprising: code to determine a closed loopforce value; code to receive an open loop force value; and code tooutput a force signal to an actuator, the force signal based at least inpart on the closed loop force value and the open loop force value. 15.The processor-executable program of claim 14 wherein the actuator iscoupled to a manipulandum, the processor-executable program furthercomprising code to receive a sensor signal from a sensor coupled to themanipulandum, the closed loop force value being associated with a closedloop force effect, determined based at least in part on the sensorsignal.
 16. The processor-executable program of claim 15 wherein theclosed loop force effect comprises at least one of a spring force, adamping force, and a texture force.
 17. The processor-executable programof claim 15 wherein the open loop force value is associated with an openloop force effect received from a host processor.
 18. Theprocessor-executable program of claim 17 wherein the open loop forceeffect comprises at least one periodic force.
 19. Theprocessor-executable program of claim 14 wherein the closed loop forcevalue is associated with a high-frequency force effect, determined basedat least in part on a command from a host processor.
 20. Theprocessor-executable program of claim 19 wherein the open loop forcevalue is associated with a low-frequency force effect, received from thehost processor.